Repository navigation
ui: MenuItems.Beside opens a menu to the right of its anchor - #6
Merged
Merged
Conversation
A Menu opened from a row of a list or popup covered the rows under it, since it could only open under or over its anchor. Beside places it to the right of the anchor, its top at the anchor's, flipping to the left when there is no room, and slides it in from that edge. The side a Menu opens on is now asked again in every paint, so a menu that stops calling Above or Beside opens under its anchor again.
xiaoyumuxi
force-pushed
the
fix/menu-beside
branch
from
November 11, 2026 10:13
3da64b7 to
0a90e7a
Compare
12 of 15 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
MenuItems.Beside()opens aMenuto the right of its anchor, its top at the anchor's, and flips it to the left when there is no room on the right. It slides in from the edge it hangs off, as a submenu does. Above and Beside now share one field, whichdeclareMenuresets in every paint, so a menu that stops calling one of them opens under its anchor again (before, a menu that once calledAbovestayed above).The guides (en, zh) mention
menu.Beside()next tomenu.Above().Why
A Menu could only open under or over its anchor. The menu of a row in a list or a popup (a branch row's actions in a branch picker, say) then covers the rows under it, which the user is still choosing among. Opening it beside the row, as a submenu opens beside its item, keeps them in sight.
How it was verified
test -z "$(gofmt -l $(git ls-files '*.go'))"go vet ./...go test ./... -count=1: everything passes except six tests ofcmd/viva(TestPackage*), which fail on this machine on base too: its Xcode SDK builds for macOS 13.0 or later while the test manifests saymin_system = 12.0. Nothing in this change reaches packaging.BenchmarkMenuOpen, 5 runs each, 2304–2390 ns/op before and 2300–2365 ns/op after, 0 B/op and 0 allocs/op bothTestMenuBesideon the headless driver; the Lithe desktop branch picker, the first caller, will be checked in a real macOS window once it adoptsBeside.Visual evidence
Menuwhose body callsmenu.Beside()TestMenuBeside's page: click "More" withbesidesetTestMenuBeside(beside the anchor, then under it again once Beside is gone)Where the boundary sits
Framework capability: placement of an overlay against its anchor, which
Box.BesideBoxalready offers to popups;Menuonly did not expose it.Cost
None for a program that does not call Beside: one switch on a byte in place of a bool test.